#!/bin/bash
clear

if [[ "$EUID" -ne 0 ]]; then
    echo "Script need to be run as root!" && exit 1
fi

if [[ ! -d /usr/local/plugins ]]; then
    mkdir /usr/local/plugins
fi

wget -q -O /usr/local/plugins/menu 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/menu'

wget -q -O /usr/local/plugins/trial 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/trial_acc.sh'
wget -q -O /usr/local/plugins/create 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/add_acc.sh'
wget -q -O /usr/local/plugins/renew 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/renew_acc.sh'
wget -q -O /usr/local/plugins/lists 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/lists_acc.sh'
wget -q -O /usr/local/plugins/login 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/login_acc.sh'
wget -q -O /usr/local/plugins/lock 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/lock_acc.sh'
wget -q -O /usr/local/plugins/unlock 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/unlock_acc.sh'
wget -q -O /usr/local/plugins/delete 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/sshdovpn/delete_acc.sh'

wget -q -O /usr/local/plugins/services 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/service/services.sh'
wget -q -O /usr/local/plugins/dropbear 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/service/dropbear.sh'
wget -q -O /usr/local/plugins/openvpn 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/service/openvpn.sh'
wget -q -O /usr/local/plugins/squid 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/service/squid.sh'
wget -q -O /usr/local/plugins/stunnel 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/service/stunnel.sh'

wget -q -O /usr/local/plugins/detail 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/server/detail.sh'
wget -q -O /usr/local/plugins/backup 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/server/backup.sh'
wget -q -O /usr/local/plugins/restore 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/server/restore.sh'
wget -q -O /usr/local/plugins/speedtest 'https://raw.githubusercontent.com/cybertize/Doct_V1.0/default/plugins/server/speedtest_cli.py'
